import request from "@/utils/request";

// GET /admin/acl/permission/toAssign/{roleId}根据角色id获取菜单
export const GetRoleIdMenuApi = (roleId) => {
  return request.get(`/admin/acl/permission/toAssign/${roleId}`);
};


// POST /admin/acl/permission/doAssign  给角色分配权限
export const doAssignApi = (roleId, permissionId) => {
  return request.post(`/admin/acl/permission/doAssign?roleId=${roleId}&permissionId=${permissionId}`);
};

// GET /admin/acl/permission 获取菜单
export const GetPermissionApi = () => {
  return request.get(`/admin/acl/permission`);
};


// POST /admin/acl/permission/save 新增菜单
export const AddPermissionApi = (Info) => {
  return request.post(`/admin/acl/permission/save`, Info);
};
// PUT /admin/acl/permission/update 修改菜单
export const updatePermissionApi = (Info) => {
  return request.put(`/admin/acl/permission/update`, Info);
};

// DELETE /admin/acl/permission/remove/{id} 删除菜单
export const deletePermissionApi = (id) => {
  return request.delete(`/admin/acl/permission/remove/${id}`);
};

